package com.remark.search.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Document(indexName = "remark",type = "docs")
public class RemarkImfo implements Serializable {

    @Id
    @Field(index = true,store = true,type = FieldType.Keyword)
    private Long id;//id

    @Field(index = true,store = true,type = FieldType.Text,analyzer = "ik_smart")
    private String name;//name
    @Field(index = true, store = true, type = FieldType.Keyword)
    private String categoryName;//name
    @Field(type = FieldType.Double,index = true)
    private Integer score;//星级
    @Field(type = FieldType.Double,index = true)
    private Integer money;//money

    private String timeScpe;//开店时间存json
    @Field(index = false,store = true,type = FieldType.Text)
    private String images;//images

    @GeoPointField
    private GeoPoint location;//地址“经度，纬度”
    //距离
    private double distance;
    @Field(index = false,store = true,type = FieldType.Text)
    private String addressName;//address_name

    private Integer commentCount;//评论数
}
